package com.aspose.cells.b.a.b.a;

import com.aspose.cells.Color;
import com.aspose.cells.a.c.zy;
import com.aspose.cells.b.a.d.zm;
import java.awt.Paint;
import java.awt.TexturePaint;
import java.awt.geom.Rectangle2D.Float;
import java.awt.image.BufferedImage;

public class zg extends com.aspose.cells.b.a.b.zc {
   private static byte[] a;
   private int b;
   private Color c;
   private Color d;

   public zg(int var1, Color var2, Color var3) {
      this.b = var1;
      this.c = var3;
      this.d = var2;
   }

   public Paint g() {
      byte[] var1 = new byte[8];
      System.arraycopy(a, this.b * 8, var1, 0, 8);
      java.awt.Color[] var2 = new java.awt.Color[]{this.b().d(), this.c().d()};
      int var3 = var2[0].getRGB();
      int var4 = var2[1].getRGB();
      Object var5 = null;
      int var7;
      byte[] var9;
      if (this.j()) {
         var9 = new byte[64];

         for(int var6 = 0; var6 < 8; ++var6) {
            for(var7 = 0; var7 < 8; ++var7) {
               int var8 = (var9[var6] & 255 & 128 >> var7) > 0 ? 1 : 0;
               var9[var7 + var6 * 8] = (byte)(var2[var8].getAlpha() & 255);
            }
         }
      } else {
         var9 = new byte[0];
      }

      BufferedImage var10 = new BufferedImage(8, 8, 5);

      for(var7 = 0; var7 < 8; ++var7) {
         var10.setRGB(0, var7, var2[var1[var7] & 1].getRGB());
         var10.setRGB(1, var7, var2[var1[var7] >> 1 & 1].getRGB());
         var10.setRGB(2, var7, var2[var1[var7] >> 2 & 1].getRGB());
         var10.setRGB(3, var7, var2[var1[var7] >> 3 & 1].getRGB());
         var10.setRGB(4, var7, var2[var1[var7] >> 4 & 1].getRGB());
         var10.setRGB(5, var7, var2[var1[var7] >> 5 & 1].getRGB());
         var10.setRGB(6, var7, var2[var1[var7] >> 6 & 1].getRGB());
         var10.setRGB(7, var7, var2[var1[var7] >> 7 & 1].getRGB());
      }

      Float var11 = new Float(0.0F, 0.0F, 8.0F, 8.0F);
      return new TexturePaint(var10, var11);
   }

   public zg a() {
      return new zg(this.b, this.d, this.c);
   }

   public void f() {
   }

   public void h() {
   }

   public Color b() {
      return this.c;
   }

   public Color c() {
      return this.d;
   }

   public int d() {
      return this.b;
   }

   public boolean j() {
      return (this.b().getA() & 255) < 255 || (this.c().getA() & 255) < 255;
   }

   // $FF: synthetic method
   public Object e() {
      return this.a();
   }

   static {
      try {
         zm var0 = zy.a("Aspose.Cells.PatternMasks.dat");

         try {
            a = new byte[(int)var0.h()];
            var0.a(a, 0, a.length);
         } finally {
            if (var0 != null) {
               var0.a();
            }

         }

      } catch (Exception var5) {
         throw new RuntimeException(var5);
      }
   }
}
